let ajaxTimecs = 0;
export const request = (params)=>{
	ajaxTimecs++;
	wx.showLoading({
		title: "数据加载中",
		mask: true,
	});
	const baseUrl = 'http://129.204.254.121/api';
	return new Promise((resolve,reject)=>{
		wx.request({
			...params,
			url: baseUrl+params.url,
			success: (result) => {
				resolve(result)
			},
			fail: (err) => {
				reject(err);
			},
			complete:()=>{
                ajaxTimecs--;
                if(ajaxTimecs === 0){
                    wx.hideLoading();
                }
            }
		});
		  
	})
}